<?php
    session_start();
include_once("../modelo/conexion.php");
//include_once("../modelo/reservas.php");
    include_once("../Inicio/cabeza.php");
    include_once("../modelo/EstadoReserva.php");


    $conn = new Conexion();
    $estado = new EstadoReserva();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>Listado de reservas</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
        <link href="../CSS/stylesheet.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" media="all" href="../jsdatepick-calendar/jsDatePick_ltr.min.css" />
        <script type="text/javascript" src="jsDatePick.min.1.3.js"></script>
        
        <script type="text/javascript">
	window.onload = function(){
		
		
		g_globalObject = new JsDatePick({
			useMode:1,
			isStripped:true,
			target:"div3"
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"beige",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});		
		
		g_globalObject.setOnSelectedDelegate(function(){
			var obj = g_globalObject.getSelectedDay();
			//alert("a date was just selected and the date is : " + obj.day + "/" + obj.month + "/" + obj.year);
			document.getElementById("div3").innerHTML = obj.day + "/" + obj.month + "/" + obj.year;
		});
		
		
		
		g_globalObject2 = new JsDatePick({
			useMode:1,
			isStripped:true,
			target:"div4",
			cellColorScheme:"beige"
			/*selectedDate:{                                        This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});
		
		g_globalObject2.setOnSelectedDelegate(function(){
			var obj = g_globalObject2.getSelectedDay();
			//alert("a date was just selected and the date is : " + obj.day + "/" + obj.month + "/" + obj.year);
			document.getElementById("div3").innerHTML = obj.day + "/" + obj.month + "/" + obj.year;
		});		
		
	};
        
        function listarReservas(cancha, estado, fechaIni, fechaFin){
            alert("pipi caca");
        }
  
</script>
        
</head>

<body>
<form name="frm_reservas" id="frm_reservas" action="Admin/ABMReservas/listar.php" method="post">
        <table cellpadding="1" cellspacing="1" border="1px">
            <tbody>
                <tr>
                    <td>Estados:</td>
                    <td><?php
                        
                        $sql = "select id_estado, nom_estado from estados_reserva order by id_estado";
                        $losEstados = $conn->Ejecuto($sql);
                        
                            if ($losEstados){
                                echo "<select name='lista_estados'>";
                                while ($reg = mysql_fetch_array($losEstados)){
                                   echo "<option value=".$reg['id_estado'].">".$reg['nom_estado']."</option>";
                                }	
                            echo "</select>";
                                
                            }else{
                                echo "error al cargar estados de reserva";
                            }                                                                
                        ?></td>
                </tr>
                <tr>
                    <td>
                        Desde:
                    </td>
                    <td>
                        <!--<input type="text" size="12" id="inFechaIni" onclick="muestroFechaIni"/>-->
                        <div id="div3" style="margin:10px 0 30px 0; width:205px; height:230px;">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        Hasta:  
                    </td>
                    <td>
                        <!--<input type="text" size="12" id="inFechaFin"  onclick="muestroFechaFin"/>-->
                        <div id="div4" style="margin:10px 0 30px 0; width:230px; height:250px;">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp; </td>
                 <!--   <td ><input type="button" value="Mostrar" name="boton" onclick="listarReservas(0,1,,)"></td>-->
                </tr>
            </tbody>
        </table>
</form>
 
    
    
    
<div id="listado_reservas">


</div>

</body>	
</html>
<?php
    include('../Inicio/pie.php');
    ?>